<script>

function curry(fn){
    return _c(fn.length, [])
    function _c(restNum, argsList){
        if(restNum === 0){
            return fn.apply(null, argsList)
        }else{
            return function(x){
                return _c(restNum-1, argsList.concat(x))
            }
        }
    }
}

var one = curry(function(){return 1})
var plus = curry(function(a,b){return a+b})
let result = plus(3)(7)
</script>